Skip to content

Phase 2: Externalize datasource secrets + remove debug output - #48

Open
devin-ai-integration[bot] wants to merge 1 commit into
devin/1783888406-phase1-ci-and-testsfrom
devin/1783889217-phase2-secrets-logging
Open

devin-ai-integration[bot] wants to merge 1 commit into
devin/1783888406-phase1-ci-and-testsfrom
devin/1783889217-phase2-secrets-logging

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 12, 2026

Copy link
Copy Markdown

Summary

Phase 2 of the modernization plan: remove committed credentials and debug noise. Version-independent, low-risk changes. Stacked on top of the Phase 1 PR (#47) so the integration-test safety net verifies behavior is unchanged (21 tests still green).

Base branch is the Phase 1 branch, not master. Once #47 merges, this retargets cleanly to master.

Secrets externalized (application.properties)

-spring.datasource.username = root
-spring.datasource.password = avengers1993
+spring.datasource.url = ${DB_URL:jdbc:mysql://localhost:3306/onlinebanking}
+spring.datasource.username = ${DB_USERNAME}
+spring.datasource.password = ${DB_PASSWORD}

Required env vars (DB_USERNAME, DB_PASSWORD, optional DB_URL) are documented in the README. The previously committed password must be treated as compromised and rotated on the DB server — flagged in the README (this repo has no infra I can rotate directly).

Credential/debug leaks removed

  • User.toString() no longer includes the password field (it would otherwise leak the (encoded) password into any log line that prints a User).
  • UserServiceImpl.disableUser: dropped two System.out.println calls; the disable action is now a single LOG.info.
  • RequestFilter: e.printStackTrace()LOG.error(...), and the System.out.println("Pre-flight")LOG.debug(...). (This filter is retired entirely in Phase 6.)

Verification

mvn clean test21 tests, 0 failures. Tests are unaffected because the test profile supplies its own H2 datasource properties, which shadow the main application.properties.

Link to Devin session: https://app.devin.ai/sessions/82be2e41fda54343a20a9b73e01c0631
Requested by: @gaelkekatos-jpg


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Open in Devin Review (Staging)

- Replace hardcoded spring.datasource username/password with ${DB_USERNAME}/
  ${DB_PASSWORD} env placeholders and a defaulted ${DB_URL}; document in README
- Drop raw password field from User.toString() to avoid leaking credentials
- Remove System.out.println debug calls in UserServiceImpl.disableUser
- Replace printStackTrace / System.out in RequestFilter with SLF4J logging

Co-Authored-By: Gael Kekatos <gael.kekatos@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants